package rfc4757import ()// StringToKey returns a key derived from the string provided according to the definition in RFC 4757.func ( string) ([]byte, error) { := make([]byte, len()*2, len()*2)for , := range { := fmt.Sprintf("%04x", ) , := hex.DecodeString()if != nil {return []byte{}, errors.New("character could not be encoded") }// Swap round the two bytes to make little endian as we put into byte slice [2*] = [1] [2*+1] = [0] } := bytes.NewReader() := md4.New() , := io.Copy(, )if != nil {return []byte{}, }return .Sum(nil), nil}func deriveKeys(, []byte, uint32, bool) (, , []byte) { = = HMAC(, UsageToMSMsgType()) = HMAC(, )return}
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.